package com.tang.design_pattern.ObservationPattern.actualPattern;

/**
 * @author tmh
 * @date 2024/3/23 20:58
 * @description 观察者模式启动类
 */
public class ObservationStart {

    public static void main(String[] args) {
        //创建B站up
        MySubject mySubject=new MySubject();

        //创建两个粉丝
        MyObserver observer1 = new OneObserver(mySubject);
        MyObserver observer2 = new TwoObserver(mySubject);

        //B站up主播发布视频
        mySubject.update();

        //控制台输出：
        /*OneObserver listen
        TwoObserver is listening!*/
    }
}
